package com.muyu.user.domain.model;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import com.muyu.user.domain.SysUserCheckin;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 签到记录分页查询返回模型
 *
 * @author liuguoqiang
 * @date 2025-09-18
 */
@Data
@SuperBuilder
@AllArgsConstructor
@Schema(description = "签到记录分页查询返回模型")
public class SysUserCheckinPageQueryModel {

    /**
     * 动作
     */
    @Schema(name = "action", title = "动作", description = "动作" )
    private String action;

    /**
     * 获得积分
     */
    @Schema(name = "pointsObtained", title = "获得积分", description = "获得积分" )
    private Long pointsObtained;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    /**
     * 信息构造器
     */
    public static SysUserCheckinPageQueryModel infoBuild(SysUserCheckin sysUserCheckin){
        return SysUserCheckinPageQueryModel.builder()
            .action(sysUserCheckin.getAction())
            .pointsObtained(sysUserCheckin.getPointsObtained())
                .createTime(sysUserCheckin.getCreateTime())
            .build();
    }

}
